﻿@using YanForum.Engine.ViewModels
@model PostItem

@{
    ViewBag.Title = Model.Title;
    Layout = "~/Views/Shared/_Layout.cshtml";
}

@section sidebar
{
    <div class="panel panel-default">
        <div class="panel-heading">
            <h3 class="panel-title">Side Bar</h3>
        </div>
        <div class="panel-body">
            Sidebar Content
        </div>
    </div>
}
<div class="post-detail row">
    <div class="col-md-12">

        <div class="form-group">
            <div class="col-md-12">
                <h1>@Model.Title</h1>
            </div>
        </div>

        <div class="form-group">
            <div class="col-md-12">
                @string.Format("{0: dd/MM/yyyy}", Model.DateUpdate)
            </div>
        </div>

        <div class="form-group text-center">
            <div class="col-md-12">
                <img src="@Model.ThumbFullPath" alt="@Model.Title" />
            </div>
        </div>
        <div class="form-group">
            <div class="col-md-12">
                @Html.Raw(Model.Content)
            </div>
        </div>
    </div>
</div>

<!--Load Comment-->
<div class="comment row">
    <div class="col-md-12">
        <div class="panel panel-default">
            <div class="panel-heading">
                <h3 class="panel-title">Ý kiến bạn đọc</h3>
            </div>
            <div class="panel-body">
                <div class="row form-comment">
                    <form action="#" id="commentForm">
                        <div class="col-md-12">
                            <textarea class="form-control txtComment" name="txtComment" id="txtComment" placeholder="Ý kiến của bạn" cols="12" rows="3"></textarea>
                        </div>
                        <div class="col-md-12">
                            <button type="submit" class="btn btn-default pull-right">Gửi</button>
                        </div>
                    </form>
                    <input type="hidden" id="ParentCommentId" value="0" />
                    <input type="hidden" id="ContentId" value="@Model.Id" />
                </div>

                <!-- List Comment -->
                <div class="list-comment ajax-paging">
                    <!-- Ajax Load Comment -->
                    @{Html.RenderAction("AjaxLoadComment", "Comment", new { area = "", contentId = Model.Id });}                    
                </div>
            </div>
        </div>
    </div>
</div>

@if (!Request.IsAuthenticated)
{
    <div class="modal fade" id="RegisterModal" tabindex="-1" role="dialog" aria-labelledby="RegisterModalLabel" aria-hidden="true" data-backdrop="static"  data-keyboard="false">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title" id="exampleModalLabel">Gửi bình luận</h4>
                </div>
                <div class="modal-body">
                    <div class="row">
                        <div class="col-md-7">
                            <div class="form-group">
                                <strong class="size-12">Đăng nhập để ý kiến của bạn xuất bản nhanh hơn</strong>
                            </div>
                            <div class="form-group">
                                <div class="link-social">
                                    <a href="#" class="pull-left social-item"><i class="modal-social-login modal-social-facebook"></i></a>&nbsp;&nbsp;&nbsp;
                                    <a href="#" class="pull-left social-item"><i class="modal-social-login modal-social-google"></i></a>
                                </div>
                                <div class="clearfix"></div>
                            </div>
                            <div class="form-group" style="margin-bottom: 0;">
                                <button class="btn btn-danger" id="modal-showlogin" style="width: 100%;">Tài khoản Yan</button>
                            </div>
                            <div class="modal-form-login hide">
                                <form id="modal-formlogin">
                                    <div class="form-group">
                                        <input type="text" name="UserName" id="UserName" class="form-control" placeholder="Tên đăng nhập">
                                    </div>
                                    <div class="form-group">
                                        <input type="password" name="Password" id="Password" class="form-control" placeholder="Mật khẩu">
                                    </div>
                                    <div class="form-group">
                                        <button type="submit" class="btn btn-danger pull-right">Đăng nhập</button>
                                    </div>
                                </form>
                            </div>
                        </div>
                        <div class="col-md-5">
                            <div>Hoặc nhập thông tin của bạn</div>
                            <form id="modal-form-submitinfo">
                                <div class="form-group">
                                    <input type="text" name="Email" id="Email" class="form-control" placeholder="Email">
                                </div>
                                <div class="form-group">
                                    <input type="text" name="FullName" id="FullName" class="form-control" placeholder="Họ và tên">
                                </div>
                                <div class="form-group">
                                    <button type="submit" class="btn btn-danger pull-right">Hoàn tất</button>
                                </div>
                            </form>
                        </div>
                    </div>

                </div>
                <div class="modal-footer">
                    <div class="pull-left">
                        Bạn chưa có tài khoản? <a href="@Url.Action("Register", "Account", new { area = "" })" class="text-error"><strong>Đăng ký</strong></a> ngay
                    </div>
                </div>
            </div>
        </div>
    </div>
}


@section scripts
{
    @Scripts.Render("~/bundles/common_frontend")
}